<?php
/*  
  Copyright (c) 2010-02 SongCMS 
  SongCMS All Rights Reserved. 
  Support:www.SongCMS.com
  QQ:544255858   19951025
  Author:Song  Version:3.17
  Date:2010-08-12 09:28:32
*/

include_once('Admin.php');
if (!is_numeric($_GET['ID'])) {MsgBox (1,'ID参数出现非数字错误！','-1');}
if($_POST['Action']=='Reply'){
	trim($_POST['GuestBookResumes']) != '' ? $GuestBookResumes = $_POST['GuestBookResumes'] : $GuestBookResumes = NULL;
	if($db->ExecuteSQL("UPDATE `" . $dbprefix . "guestbook` SET `GuestBookShow` = '" . $_POST['GuestBookShow'] . "',
		`GuestBookResumes` = '" . $GuestBookResumes . "',`GuestBookResumesName`='" . $_SESSION['UserName'] . "',																	 
		`GuestBookResumesTime` = NOW() WHERE `ID` = '" . $_GET['ID'] . "' LIMIT 1 ;")){
		AdminLog(1,$Lang,'回复客户留言(ID:' . $_GET['ID'] . ')，结果：操作成功！'); 
		if($_POST['isHTML'] == 'yes'){
			MsgBox(0,'',"HtmlComplex.php?Lang={$Lang}&Action=ComplexGuestBook");
		}		
		MsgBox (1,'操作成功！','GuestBookManage.php?Lang=' . $Lang . '&page=' . $_GET['page']);		
	}else{
		AdminLog(1,$Lang,'回复客户留言(ID:' . $_GET['ID'] . ')，结果：操作失败！'); 
		MsgBox (1,'操作失败！','-1');	
	}	
}

$Book = $db->SelectSQL("SELECT `GuestBookName`,`GuestBookImg`,`GuestBookMail`,`GuestBookTel`,`GuestBookFax`,`GuestBookCompany`,`GuestBookAddress`,
`GuestBookQQ`,`GuestBookSex`,`GuestBookTitle`,`GuestBookContent`,`GuestBookUser`,`GuestBookIP`,`GuestBookTime`,`GuestBookShow`,`GuestBookResumes`,
`GuestBookResumesName`,`GuestBookResumesTime` FROM `" . $dbprefix . "guestbook` WHERE `ID` = '" . $_GET['ID'] . "'");
if(count($Book)==0){MsgBox (1,'该留言不存在或者已经删除！','-1');}
Html($Book[0]);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="./images/adminstyle.css" rel="stylesheet" type="text/css" />
<link rel="Shortcut Icon" href="../favicon.ico">
<link rel="Bookmark" href="../favicon.ico">
<script src="../js/csshovernotie6.js" type="text/javascript"></script>
</head>
<body>
<br />
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr class="Notodd">
		<td>&nbsp;</td>
		<td align="right">
			<input type="button" value="留言管理" onClick="javascript:location.href='GuestBookManage.php?Lang=<?php echo $Lang?>'">
		</td>
	</tr>
</table>
<table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
  <form id="form1" name="form1" method="post" action="GuestBookReply.php?Lang=<?php echo $Lang?>&page=<?php echo $_GET['page']?>&ID=<?php echo $_GET['ID']?>">
  <tr class="odd">
    <td colspan="4" align="center" class="Main_Title">回复留言管理<?php echo $OnWebLangName?></td>
  </tr>
  <tr class="odd">
    <td width="100" height="23" align="right">用 户 名：</td>
    <td><?php echo htmlspecialchars($Book[0][0])?></td>
    <td align="right">性　　别：</td>
    <td><?php if($Book[0][8]==0) echo '女'; else echo '男';?></td>
  </tr>
  
  <tr class="odd">
    <td height="23" align="right">邮　　箱：</td>
    <td><?php echo htmlspecialchars($Book[0][2])?></td>
    <td align="right">联系电话：</td>
    <td><?php echo htmlspecialchars($Book[0][3])?></td>
  </tr>
  
  <tr class="odd">
    <td height="23" align="right">公司传真：</td>
    <td><?php echo htmlspecialchars($Book[0][4])?></td>
    <td align="right">公司名称：</td>
    <td><?php echo htmlspecialchars($Book[0][5])?></td>
  </tr>
  
  <tr class="odd">
    <td height="23" align="right">公司地址：</td>
    <td><?php echo htmlspecialchars($Book[0][6])?></td>
    <td align="right">QQ号：</td>
    <td><?php echo htmlspecialchars($Book[0][7])?></td>
  </tr>
  
  <tr class="odd">
    <td height="23" align="right">留言者IP地址：</td>
    <td><?php echo $Book[0][12]?></td>
    <td align="right">留言时间：</td>
    <td><?php echo $Book[0][13]?></td>
  </tr>
  
  <tr class="odd">
    <td height="23" align="right">留言主题：</td>
    <td colspan="3"><?php echo htmlspecialchars($Book[0][9])?></td>
    </tr>
  <tr class="odd">
    <td height="23" align="right">留言内容：</td>
    <td colspan="3"><?php echo htmlspecialchars($Book[0][10])?></td>
    </tr>
  <tr class="odd">
    <td height="23" align="right">管理员回复：</td>
    <td colspan="3">
      <textarea name="GuestBookResumes" cols="60" rows="6" id="GuestBookResumes"><?php echo htmlspecialchars($Book[0][15])?></textarea>
      &nbsp;支持Html语法</td>
    </tr>
  <tr class="odd">
    <td height="23" align="right">审　　核：</td>
    <td colspan="3">
      <input name="GuestBookShow" type="radio" id="radio" value="1" <?php if($Book[0][14]==1) echo 'checked="checked"';?> />通过审核
      <input type="radio" name="GuestBookShow" id="radio2" value="0" <?php if($Book[0][14]==0) echo 'checked="checked"';?> />取消审核</td>
    </tr>
  <tr class="odd">
    <td height="23" align="right">回 复 人：</td>
    <td><?php echo $Book[0][16]?></td>
    <td align="right">回复时间：</td>
    <td><?php echo $Book[0][17]?></td>
  </tr>
<?php if($WebStaticHTML == 1){?>
  <tr class="odd">
  	<td align="right">生成静态：</td>
  	<td><input name="isHTML" type="checkbox" id="isHTML" value="yes" checked="checked" />生成HTML</td>
  	<td colspan="2">提交后将同时生成与该留言相关的HTML静态文件</td>
  	</tr>
<?php }?>	   
  <tr class="odd">
    <td align="right">&nbsp;</td>
    <td colspan="3">
      <input type="submit" name="button" id="button" value="提 交" class="submit" />
      <input name="Action" type="hidden" id="Action" value="Reply" />
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" name="button2" id="button2" value="重 置" class="submit" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="返 回" class="submit" name="xxx0" onclick="history.back(-1)"></td>
    </tr>
    </form>
  </table>
</body>
</html>
